package com.example.a513;

import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.viewpager.widget.PagerTabStrip;
import androidx.viewpager.widget.ViewPager;

import java.util.List;

import adpater.ImagerPagerAdapter;
import entity.Animation;

public class PagerTabActivity extends AppCompatActivity {
    private ViewPager viewPager;
    private PagerTabStrip pagerTabStrip;
    private List<Animation> list;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_pager_tab);

        initPagerStrip();
        initViewPager();
    }

    private void initPagerStrip() {
        pagerTabStrip = findViewById(R.id.pts_tab);
        pagerTabStrip.setTextSize(TypedValue.COMPLEX_UNIT_SP,20);
        pagerTabStrip.setTextColor(Color.BLACK);

    }

    private void initViewPager() {
        viewPager = findViewById(R.id.view_pager);
        list = Animation.getDefault();
        ImagerPagerAdapter adapter = new ImagerPagerAdapter(this, list);
        viewPager.setAdapter(adapter);
    }
}